package com.wyl.dao

import com.wyl.pojo.User
import org.apache.ibatis.annotations.*

interface UserMapper {
    /** 查询全部用户 */
    @Select("select * from user")
    fun getUserList(): List<User>

    @Select("select * from user where id = #{id}")
    fun getUserById(@Param("id") id: Int): User

    @Insert("insert into user(id, name, pwd) values (#{id},#{name},#{pwd})")
    fun addUser(user: User)

    @Update("update user set name=#{name}, pwd=#{pwd} where id=#{id}")
    fun updateUser(user: User)

    @Delete("delete from user where id = #{id}")
    fun deleteUser(id: Int)
}